//
//  UIView+HLRespond.m
//  weibo-OC
//
//  Created by 黄力 on 15/12/24.
//  Copyright © 2015年 HLTest. All rights reserved.
//

#import "UIView+HLRespond.h"

@implementation UIView (HLRespond)

- (UINavigationController *)getNavigationController {
    //获取下一个响应者
    UIResponder *next = [self nextResponder];
    //遍历响应者链条并判断
    do {
        if ([next isKindOfClass:[UINavigationController class]]) {
            return (UINavigationController *)next;
        }
        next = [next nextResponder];
    } while (next != nil);
    
    return nil;
}

@end
